<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Rinda::TupleEntry - rinda: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><span class="include">DRbUndumped</span>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-5B-5D">#[]</a>
    <li ><a href="#method-i-alive-3F">#alive?</a>
    <li ><a href="#method-i-cancel">#cancel</a>
    <li ><a href="#method-i-canceled-3F">#canceled?</a>
    <li ><a href="#method-i-expired-3F">#expired?</a>
    <li ><a href="#method-i-fetch">#fetch</a>
    <li ><a href="#method-i-get_renewer">#get_renewer</a>
    <li ><a href="#method-i-make_expires">#make_expires</a>
    <li ><a href="#method-i-make_tuple">#make_tuple</a>
    <li ><a href="#method-i-renew">#renew</a>
    <li ><a href="#method-i-size">#size</a>
    <li ><a href="#method-i-value">#value</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Rinda::TupleEntry">
    <h1 id="class-Rinda::TupleEntry" class="class">
      class Rinda::TupleEntry
    </h1>

    <section class="description">
    
<p>A <a href="TupleEntry.html"><code>TupleEntry</code></a> is a <a href="Tuple.html"><code>Tuple</code></a> (i.e. a possible entry in some Tuplespace) together with expiry and cancellation data.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-expires" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">expires</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(ary, sec=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a <a href="TupleEntry.html"><code>TupleEntry</code></a> based on <code>ary</code> with an optional renewer or expiry time <code>sec</code>.</p>

<p>A renewer must implement the <code>renew</code> method which returns a Numeric, nil, or true to indicate when the tuple has expired.</p>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">ary</span>, <span class="ruby-identifier">sec</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@cancel</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@expires</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@tuple</span> = <span class="ruby-identifier">make_tuple</span>(<span class="ruby-identifier">ary</span>)
  <span class="ruby-ivar">@renewer</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">renew</span>(<span class="ruby-identifier">sec</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-5B-5D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">[]</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Retrieves <code>key</code> from the tuple.</p>

                              <div class="method-source-code" id="5B-5D-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 110</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">[]</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@tuple</span>[<span class="ruby-identifier">key</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-alive-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">alive?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>A <a href="TupleEntry.html"><code>TupleEntry</code></a> is dead when it is canceled or expired.</p>

                              <div class="method-source-code" id="alive-3F-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 44</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">alive?</span>
  <span class="ruby-operator">!</span><span class="ruby-identifier">canceled?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">expired?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cancel" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cancel</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Marks this <a href="TupleEntry.html"><code>TupleEntry</code></a> as canceled.</p>

                              <div class="method-source-code" id="cancel-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 37</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cancel</span>
  <span class="ruby-ivar">@cancel</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-canceled-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">canceled?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the canceled status.</p>

                              <div class="method-source-code" id="canceled-3F-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 57</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">canceled?</span>; <span class="ruby-ivar">@cancel</span>; <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-expired-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">expired?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Has this tuple expired? (true/false).</p>

<p>A tuple has expired when its expiry timer based on the <code>sec</code> argument to initialize runs out.</p>

                              <div class="method-source-code" id="expired-3F-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 65</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">expired?</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@expires</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@expires</span> <span class="ruby-operator">&gt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@renewer</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-identifier">renew</span>(<span class="ruby-ivar">@renewer</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@expires</span>
  <span class="ruby-keyword">return</span> <span class="ruby-ivar">@expires</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-fetch" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">fetch</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Fetches <code>key</code> from the tuple.</p>

                              <div class="method-source-code" id="fetch-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 117</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">fetch</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@tuple</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-make_expires" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">make_expires</span><span
                                class="method-args">(sec=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns an expiry Time based on <code>sec</code> which can be one of:</p>
<dl class="rdoc-list note-list"><dt>Numeric
<dd>
<p><code>sec</code> seconds into the future</p>
</dd><dt><code>true</code>
<dd>
<p>the expiry time is the start of 1970 (i.e. expired)</p>
</dd><dt><code>nil</code>
<dd>
<p>it is  Tue Jan 19 03:14:07 GMT Standard Time 2038 (i.e. when UNIX clocks will die)</p>
</dd></dl>

                              <div class="method-source-code" id="make_expires-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 96</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">make_expires</span>(<span class="ruby-identifier">sec</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">sec</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Numeric</span>
    <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sec</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">true</span>
    <span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-value">1</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-value">2</span><span class="ruby-operator">**</span><span class="ruby-value">31</span><span class="ruby-value">-1</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-make_tuple" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">make_tuple</span><span
                                class="method-args">(ary)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a <a href="Tuple.html"><code>Rinda::Tuple</code></a> for <code>ary</code>.</p>

                              <div class="method-source-code" id="make_tuple-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 131</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">make_tuple</span>(<span class="ruby-identifier">ary</span>)
  <span class="ruby-constant">Rinda</span><span class="ruby-operator">::</span><span class="ruby-constant">Tuple</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ary</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-renew" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">renew</span><span
                                class="method-args">(sec_or_renewer)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Reset the expiry time according to <code>sec_or_renewer</code>.</p>
<dl class="rdoc-list note-list"><dt><code>nil</code>
<dd>
<p>it is set to expire in the far future.</p>
</dd><dt><code>true</code>
<dd>
<p>it has expired.</p>
</dd><dt>Numeric
<dd>
<p>it will expire in that many seconds.</p>
</dd></dl>

<p>Otherwise the argument refers to some kind of renewer object which will reset its expiry time.</p>

                              <div class="method-source-code" id="renew-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 84</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">renew</span>(<span class="ruby-identifier">sec_or_renewer</span>)
  <span class="ruby-identifier">sec</span>, <span class="ruby-ivar">@renewer</span> = <span class="ruby-identifier">get_renewer</span>(<span class="ruby-identifier">sec_or_renewer</span>)
  <span class="ruby-ivar">@expires</span> = <span class="ruby-identifier">make_expires</span>(<span class="ruby-identifier">sec</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-size" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">size</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>The size of the tuple.</p>

                              <div class="method-source-code" id="size-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 124</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">size</span>
  <span class="ruby-ivar">@tuple</span>.<span class="ruby-identifier">size</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-value" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">value</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Return the object which makes up the tuple itself: the Array or Hash.</p>

                              <div class="method-source-code" id="value-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 52</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">value</span>; <span class="ruby-ivar">@tuple</span>.<span class="ruby-identifier">value</span>; <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-get_renewer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_renewer</span><span
                                class="method-args">(it)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a valid argument to <a href="TupleEntry.html#method-i-make_expires"><code>make_expires</code></a> and the renewer or nil.</p>

<p>Given <code>true</code>, <code>nil</code>, or Numeric, returns that value and <code>nil</code> (no actual renewer).  Otherwise it returns an expiry value from calling <code>it.renew</code> and the renewer.</p>

                              <div class="method-source-code" id="get_renewer-source">
            <pre><span class="ruby-comment"># File rinda/tuplespace.rb, line 144</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_renewer</span>(<span class="ruby-identifier">it</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">it</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Numeric</span>, <span class="ruby-keyword">true</span>, <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">it</span>, <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-keyword">return</span> <span class="ruby-identifier">it</span>.<span class="ruby-identifier">renew</span>, <span class="ruby-identifier">it</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span>
      <span class="ruby-keyword">return</span> <span class="ruby-identifier">it</span>, <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

